<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$item = pdo_get('zh_hkad_active',array('uniacid'=>$_W['uniacid']));
if(checksubmit('submit')){
        $data['title']=$_GPC['title'];
        // $data['content']=html_entity_decode($_GPC['content']);
        $data['company']=$_GPC['company'];
        $data['tel']=$_GPC['tel'];
        $data['money']=$_GPC['money'];
        $data['people']=$_GPC['people'];
        $data['address']=$_GPC['address'];
        $data['time']=$_GPC['time'];
        $data['totime']=$_GPC['totime'];
        $data['content']=html_entity_decode($_GPC['content']);
        // $data['time']=date('Y-m-d H:i:s',time());
        $data['uniacid']=$_W['uniacid'];
        if($_GPC['id']==''){  
            $rst=pdo_insert('zh_hkad_active',$data);      
            if($rst){
                 message('添加成功！', $this->createWebUrl('active'), 'success');
            }else{
                 message('添加失败！','','error');
            }
        }else{
             $rst=pdo_update('zh_hkad_active',$data,array('id'=>$_GPC['id']));
            if($rst){
                 message('编辑成功！', $this->createWebUrl('active'), 'success');
            }else{
                 message('编辑失败！','','error');
            }
        }
}
include $this->template('web/active');